﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CHR.Contracts;
using Kingdee.BOS;

namespace CHR.App.Core
{
    public class HRServiceHelper
    {
        public static T GetService<T>()
        {
            if (ServiceFactory._mapServer == null)
            {
                ServiceFactory.RegisterService();
            }
            string serviceName = string.Empty;
            return new ServicesContainer().GetService<T>(typeof(T).AssemblyQualifiedName, "");
            //ServiceFactory._mapServer.TryGetValue(typeof(T).AssemblyQualifiedName, out serviceName);
            //if (string.IsNullOrWhiteSpace(serviceName))
            //{
            //    throw new OperationCanceledException("the requested service not exist!");                
            //}
            //RemoteCommunication rpc = new RemoteCommunication("");
            //return rpc.CreateObject<T>(serviceName);
        }
    }
}
